<?php

/* @var $this yii\web\View */
/* @var $searchModel backend\models\searches\DictionayTypeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

use yii\helpers\Html;
use kartik\export\ExportMenu;
use kartik\grid\GridView;

$this->title = '数据字典';
$this->params['breadcrumbs'][] = $this->title;
$search = "$('.search-button').click(function(){
	$('.search-form').toggle(1000);
	return false;
});";
$this->registerJs($search);
?>

<div class="dictionary-type-index" style="overflow: hidden">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <div class="search-form" style="display:none">
        <?=  $this->render('_search', ['model' => $searchModel]); ?>
    </div>
    <?php
    $gridColumn = [
        ['class' => 'yii\grid\SerialColumn'],
        'code',
        'name',
        'order_num',
        'customizable',
        [
            'class' => 'yii\grid\ActionColumn',
        ],
    ];
    ?>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => $gridColumn,
        'pjax' => true,
        'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container-dictionary-type']],
        'panel' => [
            'type' => ' pannel-min-height',
            'panelPrefix' => 'panel pannel-min-height panel-',
            'heading' => '<i class="glyphicon glyphicon-list"></i> 数据字典',
            'before'=>'',
            'after'=>'<div class="clearfix"></div>',
        ],
        'export' => false,
        // your toolbar can include the additional full export menu
        'toolbar' => [
            'content' => Html::a('<i class="glyphicon glyphicon-plus"></i>', ['create'],
                    ['title'=> '创建患者档案','class'=>'btn btn-default']).
                Html::a('<i class="glyphicon glyphicon-repeat"></i>', [''],
                    ['data-pjax'=>1, 'class'=>'btn btn-default', 'title'=>'刷新']).
                Html::a('<i class="glyphicon glyphicon-search"></i>',[''],['class'=>'btn btn-default search-button', 'title'=>'查询']),
            '{export}',
        ],
    ]); ?>

</div>

